/**
 * 
 */
package com.dream.house.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cn.com.servyou.base.dao.BaseDAO;
import cn.com.servyou.base.exception.DAOException;

import com.dream.house.dao.GroupDAO;
import com.dream.house.entity.GroupDTO;

/**
 * @author ahk
 * @since 1.0
 */
public class GroupDAOImpl extends BaseDAO implements GroupDAO {

	/* (non-Javadoc)
	 * @see com.dream.house.dao.GroupDAO#getGroup(java.lang.String)
	 */
	@Override
	public GroupDTO getGroup(String id) throws DAOException {
		return (GroupDTO)getEntity("getGroup",id);
	}

	@Override
	public String getGroupName(String id) throws DAOException {
		return (String)getEntity("getGroupName",id);
	}

	/* (non-Javadoc)
	 * @see com.dream.house.dao.GroupDAO#getAllGroups()
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<GroupDTO> getGroups(String userId) throws DAOException {
		Map<String,String> map=new HashMap<String,String>();
		map.put("userId",userId);
		
		return (List<GroupDTO>)getEntitys("getGroups",map);
	}

	/* (non-Javadoc)
	 * @see cn.com.servyou.base.dao.BaseDAO#getEntityName()
	 */
	@Override
	public String getEntityName() {
		return GroupDTO.class.getCanonicalName();
	}

}
